package com.yhc.service;

import com.yhc.dao.UserDao;
import com.yhc.dao.impl.UserDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author yhc
 * @create 2021-07-11-14:13
 */
//@Component("userService")
@Service("userService")
public class UserService {
    //    @Autowired
//    @Qualifier("userDao")
    @Resource(name = "userDao")
    UserDao userDao;

    public void doSome() {
        userDao.save();
    }

    UserService(UserDao userDao) {
        this.userDao = userDao;
    }

    public void setUserDao(UserDaoImpl userDao) {
        this.userDao = userDao;
    }
}
